.class public Lcom/android/inputmethod/latin/dark/LatinIMESettings;
.super Landroid/preference/PreferenceActivity;
.source "LatinIMESettings.java"

# interfaces
.implements Landroid/content/SharedPreferences$OnSharedPreferenceChangeListener;


# static fields
.field private static final DEVICE_KEYBOARD_CATEGORY:Ljava/lang/String; = "device_keyboard_settings"

.field private static final PREDICTION_SETTINGS_KEY:Ljava/lang/String; = "prediction_settings"

.field private static final PREF_SHOW_COMPLETIONS_DKB:Ljava/lang/String; = "show_completions"

.field private static final SHOW_SUGGESTIONS_KEY:Ljava/lang/String; = "show_suggestions"


# instance fields
.field private mDeviceKeyboardCategory:Landroid/preference/PreferenceCategory;

.field private mQuickFixes:Landroid/preference/CheckBoxPreference;

.field private mShowCompletions:Landroid/preference/CheckBoxPreference;

.field private mShowSuggestions:Landroid/preference/CheckBoxPreference;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 31
    invoke-direct {p0}, Landroid/preference/PreferenceActivity;-><init>()V

    return-void
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 3
    .parameter "icicle"

    .prologue
    .line 50
    invoke-super {p0, p1}, Landroid/preference/PreferenceActivity;->onCreate(Landroid/os/Bundle;)V

    .line 51
    const v1, 0x7f04000c

    invoke-virtual {p0, v1}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->addPreferencesFromResource(I)V

    .line 53
    const-string v1, "show_suggestions"

    invoke-virtual {p0, v1}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->mShowSuggestions:Landroid/preference/CheckBoxPreference;

    .line 54
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->getPreferenceManager()Landroid/preference/PreferenceManager;

    move-result-object v1

    invoke-virtual {v1}, Landroid/preference/PreferenceManager;->getSharedPreferences()Landroid/content/SharedPreferences;

    move-result-object v1

    invoke-interface {v1, p0}, Landroid/content/SharedPreferences;->registerOnSharedPreferenceChangeListener(Landroid/content/SharedPreferences$OnSharedPreferenceChangeListener;)V

    .line 57
    const-string v1, "device_keyboard_settings"

    invoke-virtual {p0, v1}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/PreferenceCategory;

    iput-object v1, p0, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->mDeviceKeyboardCategory:Landroid/preference/PreferenceCategory;

    .line 58
    const-string v1, "show_completions"

    invoke-virtual {p0, v1}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    check-cast v1, Landroid/preference/CheckBoxPreference;

    iput-object v1, p0, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->mShowCompletions:Landroid/preference/CheckBoxPreference;

    .line 59
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v0

    .line 60
    .local v0, config:Landroid/content/res/Configuration;
    iget v1, v0, Landroid/content/res/Configuration;->keyboard:I

    const/4 v2, 0x2

    if-eq v1, v2, :cond_0

    .line 61
    iget-object v1, p0, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->mDeviceKeyboardCategory:Landroid/preference/PreferenceCategory;

    iget-object v2, p0, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->mShowCompletions:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v1, v2}, Landroid/preference/PreferenceCategory;->removePreference(Landroid/preference/Preference;)Z

    .line 62
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

    move-result-object v1

    iget-object v2, p0, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->mDeviceKeyboardCategory:Landroid/preference/PreferenceCategory;

    invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

    .line 65
    :cond_0
    return-void
.end method

.method protected onDestroy()V
    .locals 1

    .prologue
    .line 81
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->getPreferenceManager()Landroid/preference/PreferenceManager;

    move-result-object v0

    invoke-virtual {v0}, Landroid/preference/PreferenceManager;->getSharedPreferences()Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0, p0}, Landroid/content/SharedPreferences;->unregisterOnSharedPreferenceChangeListener(Landroid/content/SharedPreferences$OnSharedPreferenceChangeListener;)V

    .line 83
    invoke-super {p0}, Landroid/preference/PreferenceActivity;->onDestroy()V

    .line 84
    return-void
.end method

.method protected onResume()V
    .locals 2

    .prologue
    .line 69
    invoke-super {p0}, Landroid/preference/PreferenceActivity;->onResume()V

    .line 70
    invoke-virtual {p0}, Lcom/android/inputmethod/latin/dark/LatinIMESettings;->getListView()Landroid/widget/ListView;

    move-result-object v1

    invoke-static {v1}, Landroid/text/AutoText;->getSize(Landroid/view/View;)I

    move-result v0

    .line 71
    .local v0, autoTextSize:I
    const/4 v1, 0x1

    if-ge v0, v1, :cond_0

    .line 77
    :cond_0
    return-void
.end method

.method public onSharedPreferenceChanged(Landroid/content/SharedPreferences;Ljava/lang/String;)V
    .locals 1
    .parameter "sharedPreferences"
    .parameter "key"

    .prologue
    .line 88
    new-instance v0, Landroid/backup/BackupManager;

    invoke-direct {v0, p0}, Landroid/backup/BackupManager;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0}, Landroid/backup/BackupManager;->dataChanged()V

    .line 89
    return-void
.end method
